﻿using B.S.Data.ERP.API.Applications.WarehouseDealiy.Command;
using ERP.Domain;
using ERP.infratrctrue;
using ERP.Requst;
using MediatR;

namespace B.S.Data.ERP.API.Applications.WarehouseDealiy.CommandHandler
{
    public class ShowWarehouseDealiCommandHandler : IRequestHandler<ShowWarehouseDealiCommand, APIRequust<List<ChuKuInfo>>>
    {
        private readonly IBaseRepository<ChuKuInfo> _chukuinfoRepository;
        public ShowWarehouseDealiCommandHandler(IBaseRepository<ChuKuInfo> chukuinfoRepository)
        {
            _chukuinfoRepository = chukuinfoRepository;
        }
        public Task<APIRequust<List<ChuKuInfo>>> Handle(ShowWarehouseDealiCommand request, CancellationToken cancellationToken)
        {
            APIRequust<List<ChuKuInfo>> result = new APIRequust<List<ChuKuInfo>>();
            result.Code = RequstCode.成功;
            result.Msg = RequstCode.成功.ToString();

            var ment=_chukuinfoRepository.GetAll();
            result.Data=ment;

            return Task.FromResult(result);

        }
    }
}
